/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Math;
import java.lang.Math;
/**
 *
 * @author Carter
 */
public final class AxisControl {
    double exp = 0;
    double expGained;
    double expAdded;
    double newEXP;
    double totalExpToLevel;


    public AxisControl(){
    
    }
    public double getDifferenceX(double userX, double endX){  //If negative move left on the x axis. If positive move right on the x axis 
        double xDiff = (endX - userX);
        return xDiff;
    }
    
     public double getDifferenceY(double userY, double endY){  //If negative move backward on the y axis. If positive move forward on the y axis 
        double yDiff = (endY - userY);
        return yDiff;
    } 
    
     public double getDifferenceZ(double userZ, double endZ){  //If negative move down on the z axis. If positive move up on the z axis 
        double zDiff = (endZ - userZ);
        return zDiff;
    } 
    
    public double getDistanceToPoint(double userX, double userY, double userZ, double endX, double endY, double endZ){
       double xDiff = (endX - userX);
       double yDiff = (endY - userY);
       double zDiff = (endZ - userZ);
       double distance = Math.sqrt((xDiff * xDiff)+(yDiff *yDiff) + (zDiff * zDiff));
       return distance;
    }

    public double getDistanceToPoint(double xDiff, double yDiff, double zDiff){
       double distance = Math.sqrt((xDiff * xDiff)+(yDiff *yDiff) + (zDiff * zDiff));
       return distance;
    }


    public double newEnergy(double energy, double distance){
        double newEnergy = (energy - distance);
        if (newEnergy < 0){
            System.out.println("Not enough energy");
        }
        else{
            energy = newEnergy;
        }
        return energy;
    }

    public double expGained(double distance, double level){
        expGained = (distance*distance) + (2 * level);
        return expGained;
    }

    public double newEXP(double expGained){
        expAdded = expGained;
        newEXP =(expAdded+exp);
        exp = newEXP;
        return exp;
    }

    public double totalExpToLevel(double energy, double level){
        totalExpToLevel = (level * level) + ((3 * energy) / 2);
        return totalExpToLevel;
    }

}
